import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '是否启用aps(0否 1是)',
    align:"center",
    dataIndex: 'isAps',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'1'},{text:'否',value:'0'}])
     },
   },
   {
    title: '是否启用 第三方erp (0无 1u9 2KIS 3易飞 4TIPTOP 5易10)',
    align:"center",
    dataIndex: 'isThirdErp_dictText'
   },
   {
    title: '销售订单数据推送U9',
    align:"center",
    dataIndex: 'salesOrderDataPushU9'
   },
   {
    title: '计划推送结果(0 无  1请购单 2采购单)',
    align:"center",
    dataIndex: 'planPushResults_dictText'
   },
   {
    title: '当前业务会计期间',
    align:"center",
    dataIndex: 'currentBusinessPeriod'
   },
   {
    title: '租户id',
    align:"center",
    dataIndex: 'tenantId'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '启用APS',
    field: 'isAps',
    defaultValue: 0,
     component: 'JSwitch',
     componentProps:{
         options:[1,0]
     },
  },
  {
    label: '第三方ERP',
    field: 'isThirdErp',
    component: 'JDictSelectTag',
    componentProps:{
      options: [
        { label: '无', value: 0 },
        { label: 'u9', value: 1 },
        { label: 'KIS', value: 2 },
        { label: '易飞', value: 3 },
        { label: 'TIPTOP', value: 4 },
        { label: '易10', value: 5 },
      ],
     },
  },
  {
    label: '计划推送结果',
    field: 'planPushResults',
    component: 'JDictSelectTag',
    componentProps:{
      options: [
        { label: '无', value: 0 },
        { label: '请购单', value: 1 },
        { label: '采购单', value: 2 },
      ],
     },
  },
  {
    label: '当前业务会计期间',
    field: 'currentBusinessPeriod',
    component: 'DatePicker',
    componentProps: {
       showTime: false,
       valueFormat: 'YYYY-MM-DD'
     },
  },
  // {
  //   label: '销售订单数据推送U9',
  //   field: 'salesOrderDataPushU9',
  //   component: 'Switch',
  // },
  {
    label: '销售订单数据推送U9',
    field: 'salesOrderDataPushU9',
    defaultValue: 0,
     component: 'JSwitch',
     componentProps:{
         options:[1,0]
     },
  },
  {
    label: '请购单数据推送U9',
    field: 'purchasePushU9',
    defaultValue: 0,
     component: 'JSwitch',
     componentProps:{
         options:[1,0]
     },
  },
  // {
  //   label: '租户id',
  //   field: 'tenantId',
  //   component: 'InputNumber',
  // },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}